gtk: Reset children styles when changing name
authorBenjamin Otte <otte@redhat.com>
Sat, 26 Mar 2011 13:49:24 +0000 (14:49 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 26 Mar 2011 22:51:51 +0000 (23:51 +0100)
Changing the name of a widget does not just change the current widget's
path, but also the path of all its children.

gtk/gtkwidget.c

index 714f850b1b2386c263597a1edcce7cfb18164ea5..ab66dd571a0a21554e6a580dfa238dd7e182aaac 100644 (file)
@@ -6920,17 +6920,7 @@ gtk_widget_set_name (GtkWidget    *widget,
   g_free (priv->name);
   priv->name = new_name;
 
-  if (priv->path)
-    {
-      guint pos;
-
-      pos = gtk_widget_path_length (priv->path) - 1;
-      gtk_widget_path_iter_set_name (priv->path, pos,
-                                     priv->name);
-    }
-
-  if (priv->context)
-    gtk_style_context_set_path (priv->context, priv->path);
+  gtk_widget_reset_style (widget);
 
   g_object_notify (G_OBJECT (widget), "name");
 }